package com.liugui.iostream;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

/**
 * @ClassName: CopyDemo
 * @Author: liugui
 * @Date: 2020-11-06 10:41
 **/
public class CopyDemo {
    public static void main(String[] args) {
        try {
            /**
             * 复制一份文件
             */
            Files.copy(Paths.get("src/resource/1.txt"),
                    Paths.get("src/resource/2.txt"),
                    StandardCopyOption.COPY_ATTRIBUTES);
        }catch (IOException e){
            e.printStackTrace();
        }

    }
}
